package hot;

/**
 * @author lakersUp
 * @Classname   移动零
 * @Description     直接覆盖
 * @Date 2022/3/23 10:50
 * @Version 1.0
 */
public class Hot283moveZeroes {
    public void moveZeroes(int[] nums){
        int n=nums.length;
        int left=0;
        int right=0;
        while (right<n){
            if(nums[right]!=0){
                nums[left++]=nums[right];
            }
            right++;
        }
        for(int i=left;i<n;i++){
            nums[left]=0;
        }
    }
}
